{extend name="common/base" /}
{block name="content"}
    <div class="iframe_div layui-anim layui-anim-upbit">
        <div class="top_form_tool">
            <form class="layui-form" action="">
                <input type="text" name="key" lay-verify="title" autocomplete="off" placeholder="模糊搜索" class="layui-input">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="save_sub">搜索</button>
            </form>
        </div>
        <div class="clear"></div>
        <div class="table_div">
            <table class="layui-hide" id="table_list" lay-filter="table_list"></table>
        </div>
    </div>
{/block}
{block name="script"}
<script>
    layui.config({
        base: '<?php echo SITE;?>static/layuiadmin/'
    }).extend({
        index: 'lib/index'
    }).use(['index','layer','table','form'],async () => {
        const { layer,form, admin, table, $,element } = layui;

        /*渲染表格*/
        let table_list = table.render({
            elem: '#table_list'
            ,url:'/admin/log/list_data'
            ,page:true
            ,cols: [[
                {field:'id',width:80,  title: 'ID'}
                ,{field:'user',width:120,  title: '用户'}
                ,{field:'value',  title: '内容'}
                ,{field:'create_time',width:180,  title: '时间'}
            ]]
        });

        /*监听提交*/
        form.on('submit(save_sub)', function(data){
            data =data.field;
            table_list.reload({where:{key:data.key}});
            return false;
        });
    });
</script>
{/block}


{block name="template"}
{/block}